package com.ddwl.goods.dao.mapper;

import com.ddwl.common.dao.mapper.TkMapper;
import com.ddwl.goods.dao.model.Sku;
import com.ddwl.schema.bo.order.SkuStockBo;
import com.ddwl.schema.bo.goods.ItemListApiBo;
import com.ddwl.schema.bo.goods.SkuBo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/8/28 17:00
 */
@Repository
public interface SkuMapper extends TkMapper<Sku> {

    int updateByBatch(@Param("skuBos") List<SkuBo> skuBos);

    int updateStockAndPrice(@Param("skuBos") List<SkuBo> skuBos);

    int updateFactoryPrice(@Param("skuBos") List<SkuBo> skuBos);

    void updateCommission(@Param("skuBos") List<SkuBo> skuBos);

    List<Sku> querySkuList(@Param("bo") ItemListApiBo bo);

    void updateRealStock(@Param("bo") ItemListApiBo bo);

    /**
     * 商品库存
     * @param itemIds
     * @return
     */
    List<SkuStockBo> countStockByItemIds(@Param("itemIds") List<String> itemIds);
}
